# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=go-windapsearch
_binname=windapsearch
pkgver=v0.3.0.r22.ged05587
pkgrel=2
pkgdesc='Utility to enumerate users, groups and computers from a Windows domain through LDAP queries.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-recon' 'blackarch-windows')
url='https://github.com/ropnop/go-windapsearch'
license=('BSD')
makedepends=('git' 'go' 'mage')
source=("git+https://github.com/ropnop/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  mage build
}

package() {
  cd $pkgname

  install -Dm 755 $_binname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

